﻿package com.tudou.home.newskin.buttons
{
    import com.tudou.home.common.net.*;
    import flash.display.*;
    import flash.events.*;

    public class PhotoFrame extends PictureLoader
    {
        protected var frameLine:Shape;
        protected var frameAlpha:Number;
        protected var photo:DisplayObject;
        protected var frameColor:uint;

        public function PhotoFrame()
        {
            frameColor = 1644824;
            frameAlpha = 1;
            frameLine = new Shape();
            addChild(frameLine);
            return;
        }// end function

        override protected function completedHlr(event:Event) : void
        {
            super.completedHlr(event);
            addChild(frameLine);
            return;
        }// end function

        public function setFrameColorAlpha(param1:uint, param2:Number) : void
        {
            frameColor = param1;
            frameAlpha = param2;
            drawFrame();
            return;
        }// end function

        override public function setWidthHeight(param1:Number, param2:Number) : void
        {
            thisWidth = param1;
            thisHeight = param2;
            drawBackground();
            drawFrame();
            return;
        }// end function

        override protected function init() : void
        {
            drawBackground();
            drawFrame();
            return;
        }// end function

        protected function drawFrame() : void
        {
            frameLine.graphics.clear();
            frameLine.graphics.lineStyle(1, frameColor, frameAlpha, true, LineScaleMode.NONE, CapsStyle.SQUARE, JointStyle.MITER);
            frameLine.graphics.drawRect(0, 0, (thisWidth - 1), (thisHeight - 1));
            return;
        }// end function

    }
}
